﻿using Assets.Content.Scripts.DateBase.AssetBundleLoad;
using UnityEngine;
using UnityEngine.UI;

namespace Assets.Content.Scripts.UI.Widget
{
    public class Widget : MonoBehaviour
    {
        protected virtual void Awake() { }

        protected virtual void Update() { }

        protected virtual void Show()
        {
            gameObject.SetActive(true);
        }

        protected virtual void Hide()
        {
            gameObject.SetActive(false);
        }

        protected void InitAbilityValue(GameObject ability, int count)
        {
            for (var i = 0; i < count; i++)
            {
                ability.transform.GetChild(i).GetComponent<Image>().sprite =
                    LoadBundlesFromFile.Instance.CommandSprite[9];
            }
        }
    }
}
